import request from '@/utils/request';


export async function query({...resetParams}) {
  return request(`/message_boards`,{
    method:'GET',
    params:{
      ...resetParams,
      order_direction:'desc'
    }
  });
}

export async function download (id) {
  return request(`/message_boards/${id}/download`,{
    method:'GET',
  });
}
export async function remove({id}) {
  return request(`/message_boards/${id}`, {
    method: 'DELETE',
  });
}


export async function add(restParams) {
  return request(`/message_boards`, {
    method: 'POST',
    data: restParams,
  });
}
export async function addValue(restParams) {
  return request(`/notices`, {
    method: 'POST',
    data: {
      values:restParams,
    },
  });
}


export async function edit({id,...restParams}) {
  return request(`/message_boards/${id}`, {
    method: 'PUT',
    data: {
      ...restParams,
    },
  });
}


export async function read({id,...restParams}) {
  return request(`/notices/${id}/is_read`, {
    method: 'PUT',
    data: {
      is_read:1,
    },
  });
}
export async function forward({id,...restParams}) {
  return request(`/message_boards/${id}/forward`, {
    method: 'POST',
    data: restParams,
  });
}
